GtkSwitchPrivate *priv = GTK_SWITCH (widget)->priv;
GtkAllocation allocation;
+ /* Don't handle extra mouse buttons events, let them bubble up */
+ if (event->button > 5)
+ return GDK_EVENT_PROPAGATE;
+
gtk_widget_get_allocation (widget, &allocation);
if (priv->is_active)
if (event->x <= allocation.width / 2)
{
priv->in_press = TRUE;
- return TRUE;
+ return GDK_EVENT_STOP;
}
priv->offset = event->x - allocation.width / 2;
if (event->x >= allocation.width / 2)
{
priv->in_press = TRUE;
- return TRUE;
+ return GDK_EVENT_STOP;
}
priv->offset = event->x;
"gtk-dnd-drag-threshold", &priv->drag_threshold,
NULL);
- return TRUE;
+ return GDK_EVENT_STOP;
}
static gboolean
/* if this is a direct toggle we don't handle motion */
if (priv->in_press)
- return FALSE;
+ return GDK_EVENT_PROPAGATE;
if (ABS (event->x - priv->drag_start) < priv->drag_threshold)
- return TRUE;
+ return GDK_EVENT_STOP;
if (event->state & GDK_BUTTON1_MASK)
{
/* we need to redraw the handle */
gtk_widget_queue_draw (widget);
- return TRUE;
+ return GDK_EVENT_STOP;
}
- return FALSE;
+ return GDK_EVENT_PROPAGATE;
}
static gboolean
GtkSwitchPrivate *priv = GTK_SWITCH (widget)->priv;
GtkAllocation allocation;
+ /* Don't handle extra mouse buttons events, let them bubble up */
+ if (event->button > 5)
+ return GDK_EVENT_PROPAGATE;
+
gtk_widget_get_allocation (widget, &allocation);
/* dragged toggles have a "soft" grab, so we don't care whether we
* for direct toggles, instead
*/
if (!priv->is_dragging && !priv->in_switch)
- return FALSE;
+ return GDK_EVENT_PROPAGATE;
/* direct toggle */
if (priv->in_press)
priv->in_press = FALSE;
gtk_switch_set_active (GTK_SWITCH (widget), !priv->is_active);
- return TRUE;
+ return GDK_EVENT_STOP;
}
/* toggle the switch if the handle was clicked but a drag had not been
{
gtk_switch_set_active (GTK_SWITCH (widget), !priv->is_active);
- return TRUE;
+ return GDK_EVENT_STOP;
}
/* dragged toggle */
gtk_widget_queue_draw (widget);
- return TRUE;
+ return GDK_EVENT_STOP;
}
- return FALSE;
+ return GDK_EVENT_PROPAGATE;
}
static gboolean